package src.com.doit.Demo06;

public class Person {
    private String name;
    private int age;
    private int n;

    public Person() {
        System.out.println("Person的空参构造执行了");
    }
    public Person(String name, int age) {
        //默认会有个super(); 所以不冲;突
        this.name = name;
        this.age = age;
        System.out.println("Person的带参构造执行了");

    }
    public Person(String name, int age, int n) {
        //调用本类其它的构造方法
        this(name,age);

        System.out.println("Person的带参构造执行了");
        for (int i = 0; i < n; i++) {
            System.out.println("HelloWorld");

        }

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

}

